
import static java.lang.System.out;

public class Test {

	public static void main(String args[]) {
		final String BREAKER = "_______________________";

		List facotry = new List();
		facotry.put("fac0", new Factory("fac0"));
		facotry.put("fac1", new Factory("fac1"));
		facotry.put("fac2", new Factory("fac2"));
		facotry.put("fac3", new Factory("fac3"));
		facotry.put("fac4", new Factory("fac4"));
		facotry.put("fac5", new Factory("fac5"));


		Iterator iter0 = facotry.iterator();
		while (iter0.hasNext()) {
			Factory temp = (Factory) facotry.get(iter0.next());
			Robot temp_robot = new CrawlerRobot(new Welder(getRandom()));
			temp_robot.riseHours(getRandom());
			temp_robot.riseSpec(getRandom());
			temp.addRobot(temp_robot);
		}

		Iterator iter1 = facotry.iterator();
		while (iter1.hasNext()) {
			Factory temp = (Factory) facotry.get(iter1.next());
			Robot temp_robot = new CrawlerRobot(new Painter(getRandom()));
			temp_robot.riseHours(getRandom());
			temp_robot.riseSpec(getRandom());
			temp.addRobot(temp_robot);
		}

		Iterator iter2 = facotry.iterator();
		while (iter2.hasNext()) {
			Factory temp = (Factory) facotry.get(iter2.next());
			Robot temp_robot = new SwivelRobot(new Welder(getRandom()));
			temp_robot.riseHours(getRandom());
			temp_robot.riseSpec(getRandom());
			temp.addRobot(temp_robot);
		}

		Iterator iter3 = facotry.iterator();
		while (iter3.hasNext()) {
			Factory temp = (Factory) facotry.get(iter3.next());
			Robot temp_robot = new SwivelRobot(new Painter(getRandom()));
			temp_robot.riseHours(getRandom());
			temp_robot.riseSpec(getRandom());
			temp.addRobot(temp_robot);
		}

		out.println("getAvarageHours:");
		Iterator iter6 = facotry.iterator();
		while (iter6.hasNext()) {
			Object name = iter6.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvarageHours());
		}

		out.println("getAvaragePainterRotation:");
		Iterator iter7 = facotry.iterator();
		while (iter7.hasNext()) {
			Object name = iter7.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvaragePainterRotation());
		}

		out.println("getAvaragePainterTrack:");
		Iterator iter8 = facotry.iterator();
		while (iter8.hasNext()) {
			Object name = iter8.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvaragePainterTrack());
		}

		out.println("getAvarageRoleHours:");
		Iterator iter9 = facotry.iterator();
		while (iter9.hasNext()) {
			Object name = iter9.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvarageRoleHours("Painter"));
		}

		out.println("getAvarageRotation:");
		Iterator iter10 = facotry.iterator();
		while (iter10.hasNext()) {
			Object name = iter10.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvarageRotation());
		}

		out.println("getAvarageTrack:");
		Iterator iter11 = facotry.iterator();
		while (iter11.hasNext()) {
			Object name = iter11.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvarageTrack());
		}

		out.println("getAvarageTypeHours:");
		Iterator iter12 = facotry.iterator();
		while (iter12.hasNext()) {
			Object name = iter12.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvarageTypeHours("Crawler"));
		}

		out.println("getAvarageWelderRotation:");
		Iterator iter13 = facotry.iterator();
		while (iter13.hasNext()) {
			Object name = iter13.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvarageWelderRotation());
		}

		out.println("getAvarageWelderTrack:");
		Iterator iter14 = facotry.iterator();
		while (iter14.hasNext()) {
			Object name = iter14.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getAvarageWelderTrack());
		}

		out.println("getCrawlerMaxTemperature:");
		Iterator iter15 = facotry.iterator();
		while (iter15.hasNext()) {
			Object name = iter15.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getCrawlerMaxTemperature());
		}

		out.println("getCrawlerMinTemperature:");
		Iterator iter16 = facotry.iterator();
		while (iter16.hasNext()) {
			Object name = iter16.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getCrawlerMinTemperature());
		}

		out.println("getMaxTemperature:");
		Iterator iter17 = facotry.iterator();
		while (iter17.hasNext()) {
			Object name = iter17.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getMaxTemperature());
		}

		out.println("getMinTemperature:");
		Iterator iter18 = facotry.iterator();
		while (iter18.hasNext()) {
			Object name = iter18.next();
			Factory temp = (Factory) facotry.get(name);
			out.println(name + ": " + temp.getMinTemperature());
		}

	}

	private static int getRandom() {
		return (int) (Math.random() * 100);
	}
}
